package org.casscommunity.sights.client;

import org.casscommunity.sights.client.gin.AppGinjector;
import org.casscommunity.sights.client.gin.AppGinjectorManager;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.SimplePanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class CassSights implements EntryPoint {

	interface CassSightsUiBinder extends UiBinder<LayoutPanel, CassSights> { }

	private static final CassSightsUiBinder uiBinder = GWT.create(CassSightsUiBinder.class);
	
	@UiField
	SimplePanel contentPanel;
	
	public void onModuleLoad() {
		AppGinjector injector = AppGinjectorManager.getInjector();
		LayoutPanel mainPanel = uiBinder.createAndBindUi(this);
		ActivityManager activityManager = injector .getActivityManager();
		activityManager.setDisplay(contentPanel);
		RootLayoutPanel.get().add(mainPanel);
        injector.getPlaceHistoryHandler().handleCurrentHistory();
	}

}
